Technote OV 19 | March 1987 |
Some applications need to store information about configuration; others could benefit simply from allowing users to customize default ruler settings, window placement, fonts, etc.
There are applications which store this information as additional resources in the application's resource file; when the user changes the configuration, the application writes to itself to change the saved information.
AppleShare, however, requires that if an application is to be used by more than one user at a time, it must not need write access to itself. This means that the above method of storing configuration information cannot be used. (For more information about making your application sharable, see M.NW.AppleShareApps.)
Storing configuration in a special configuration file can be a problem; the user must keep the file in the system folder or the application must search for it. This process has design issues of its own.
A basis for one solution to this problem was a user-interface feature of the Lisa Office System architecture. Lisa introduced the concept of "stationery pads", special documents that created copies of themselves to allow users to save a pre-set-up document for future use. On Lisa, this was the way Untitled documents were created.
Your Macintosh application can provide the option of saving a document as a stationery pad, to provide similar functionality. Here's how:
* You'll need to add a checkbox to your SFPutFile dialog box (if you don't know how to do this, check out M.FL.SFCustomize); if the user checks this box, save the document as you normally would, but use a different file type (the file type of a document is usually set when the document is created, using the File Manager
Create procedure, or later using SetFileInfo).
A Document and its Stationery pad
* Be sure to use a different but similar icon for the stationery pad file. This is easy if you differentiate between stationery and normal files solely by file type--the Finder uses the t ype to determine which icon to display, see M.TB.Bundles for help with the "bundle" mechanism used to associate a file type with an icon.
* When opening a stationery pad file, the window should come up named "Untitled", with the contents of the stationery pad file.
* "Revert" should re-read the stationery pad file.
* Don't forget to add the stationery pad's file type to the file-types list
that you pass to Standard File, so that the new files will appear in the list
when the user chooses Open. This file type should be registered with Macintosh
Developer Technical Support.
Further Reference:
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help